var o, e = require, t = module, n = exports, i = this && this.__extends || (o = function(t, e) {
    return (o = Object.setPrototypeOf || {
        __proto__: []
    } instanceof Array && function(t, e) {
        t.__proto__ = e;
    } || function(t, e) {
        for (var a in e) e.hasOwnProperty(a) && (t[a] = e[a]);
    })(t, e);
}, function(t, e) {
    function a() {
        this.constructor = t;
    }
    o(t, e), t.prototype = null === e ? Object.create(e) : (a.prototype = e.prototype, 
    new a());
}), a = this && this.__decorate || function(t, e, a, r) {
    var n, o = arguments.length, i = o < 3 ? e : null === r ? r = Object.getOwnPropertyDescriptor(e, a) : r;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) i = Reflect.decorate(t, e, a, r); else for (var l = t.length - 1; 0 <= l; l--) (n = t[l]) && (i = (o < 3 ? n(i) : 3 < o ? n(e, a, i) : n(e, a)) || i);
    return 3 < o && i && Object.defineProperty(e, a, i), i;
};

Object.defineProperty(n, "__esModule", {
    value: !0
});

var r = e("GameData"), s = e("LoadManager"), c = e("UIManager"), l = e("Global"), d = e("ItemView"), u = e("PopBackItemView"), p = cc._decorator, h = p.ccclass, f = p.property, g = function(e) {
    function t() {
        var t = null !== e && e.apply(this, arguments) || this;
        return t.arrow = null, t.lastLight = null, t.lastRankLabel = null, t.lastNameLabel = null, 
        t.lastSprite = null, t.nextLight = null, t.nextRankLabel = null, t.nextNameLabel = null, 
        t.nextSprite = null, t;
    }
    return i(t, e), t.prototype.init = function() {
        cc.tween(this.arrow).repeatForever(cc.tween().by(.5, {
            position: cc.v2(10, 0)
        }).by(.5, {
            position: cc.v2(-10, 0)
        })).start(), cc.tween(this.lastLight).repeatForever(cc.tween().by(2, {
            angle: 60
        })).start(), cc.tween(this.nextLight).repeatForever(cc.tween().by(2, {
            angle: 60
        })).start(), PD.checkObjParam("item", "rank", "number") && (this.lastRankLabel.string = (PD.data.item.rank + 1).toString(), 
        s.default.getInstance().loadSpriteFrame({
            url: "image/arm/" + l.G.getIdxByRank(PD.data.item.rank),
            sprite: this.lastSprite
        }), this.nextRankLabel.string = (PD.data.item.rank + 2).toString(), s.default.getInstance().loadSpriteFrame({
            url: "image/arm2/" + l.G.getIdxByRank(PD.data.item.rank + 1),
            sprite: this.nextSprite
        }));
    }, t.prototype.callback = function() {
        var t;
        PD.checkObjParam("item", "rank", "number") && PD.data.item instanceof d.default && (t = Math.floor((r.GD.topRank - PD.data.item.rank - 2) * Math.random()), 
        PD.data.item.rank += 0 < t ? t : 1, PD.data.item.refresh(), PD.data.item.box.refresh(), 
        c.default.getInstance().getPnl("start").updateMatrix()), this.closePnl();
    }, a([ f(cc.Node) ], t.prototype, "arrow", void 0), a([ f(cc.Node) ], t.prototype, "lastLight", void 0), 
    a([ f(cc.Label) ], t.prototype, "lastRankLabel", void 0), a([ f(cc.Label) ], t.prototype, "lastNameLabel", void 0), 
    a([ f(cc.Sprite) ], t.prototype, "lastSprite", void 0), a([ f(cc.Node) ], t.prototype, "nextLight", void 0), 
    a([ f(cc.Label) ], t.prototype, "nextRankLabel", void 0), a([ f(cc.Label) ], t.prototype, "nextNameLabel", void 0), 
    a([ f(cc.Sprite) ], t.prototype, "nextSprite", void 0), a([ h ], t);
}(u.default);

n.default = g;